-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ci: test plugin and rdmo setup #2
Conversation
key: lint-${{ hashFiles('.pre-commit-config.yaml') }} | ||
- name: Run linters via pre-commit (ruff, eslint) | ||
run: pre-commit run --all-files --color=always | ||
uses: rdmorganiser/.github/.github/workflows/_lint.yml@main |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Proposal to use the job from the central .github
repo.
- run: python -m pip list | ||
- run: pytest -s | ||
|
||
# dev-setup: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Uncommented for now to save some time when working on this PR.
@@ -0,0 +1,9 @@ | |||
# ruff: noqa: F821 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this sufficient?
Do we need to put rdmo-plugins-radar into INSTALLED_APPS
?
@@ -0,0 +1,39 @@ | |||
from pathlib import Path |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I copied these fixtures from the rdmo repo. We can of course pull this file from the rdmo during ci.
But I guess we need to have additional fixtures here.
@@ -0,0 +1,20 @@ | |||
import pytest |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These are only dummy tests.
Maybe we could also go this way, and move all testing related stuff, like fixtures and testing config to a new repository, that you could just clone or pip install during testing in all projects? |
In principle, I like the idea, but the tests in RDMO are written with those concrete fixtures in mind, and will only work with those. Other projects do that differently. |
By other projects I meant the rdmo-plugins. Your argument still applies? The plugins need some test data as well or why are we doing this setup here? |
@MyPyDavid: This is a redo of #1.
I looked at what you wanted to achieve and tried to put it in the ci.yml.
The workflow pulls the plugin repo and gets only the
testing
directory from the rdmo repository.This leads to a "working testing setup", as you can see in the two dummy tests. I test that the plugin settings from local.py are correctly loaded into the django project settings. Also I verify the fixtures get loaded into the database.
This only works in CI though, if you run pytest locally, the rdmo testing directory is not present.
But the setup in #1 only worked in ci as well?
What do you think? Is this the way to go?